home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
cenvid
/
graphics.lib
< prev
next >
Wrap
Text File
|
1995-09-13
|
789b
|
46 lines
// GRAPHICS.LIB - Simple Cmm DOS routines to run VGA in 200x320
// ver.1 color mode, set palettes, and write pixels.
// See MANDLBRT.CMM for an example
// put vga into video mode hex13 (200x320)
StartVGA()
{
regs.ax = 0x13;
interrupt(0x10,regs);
}
// put vga back into text mode
CloseVGA()
{
regs.ax= 0x3;
interrupt(0x10,regs);
}
// place pixel of specified palette color and column,row
PutPixel(x,y,c)
{
poke(Address(0xA000,x+y*320),c);
}
// set palette color
SetPalette(n, r, g, b)
{
outport(0x3c8,n);
outport(0x3c9,r);
outport(0x3c9,g);
outport(0x3c9,b);
}
// get palette color
GetPalette(n)
{
outport(0x3c7,n);
foo.r = inport(0x3c9);
foo.g = inport(0x3c9);
foo.b = inport(0x3c9);
return foo;
}